package com.jilefojing.beans.pojos.enhanced;

import java.util.Date;

import com.jilefojing.beans.enums.GenderEnum;
import com.jilefojing.beans.pojos.WriteBook;
import com.jilefojing.beans.pojos.enhanced.base.BaseEnhanced;

/**
 * 
 * @author 作者 jgshun
 * @date 创建时间 2016年10月07日 00时08分14秒
 */
public class EnhancedWriteBook extends BaseEnhanced {
	public EnhancedWriteBook(WriteBook writeBook) {
		// TODO 自动生成 细微误差自己调整
		if (writeBook.getId() != null) {
			this.id = writeBook.getId();
		}
		this.createTime = writeBook.getCreateTime();
		this.writeUserName = writeBook.getWriteUserName();
		if (writeBook.getGender() != null) {
			this.gender = GenderEnum.getGenderEnumByCode(writeBook.getGender());
		}
		if (writeBook.getAge() != null) {
			this.age = writeBook.getAge();
		}
		if (writeBook.getLoginUser() != null) {
			EnhancedUser enhancedUser = new EnhancedUser();
			enhancedUser.setId(writeBook.getLoginUser());
			this.enhancedLoginUser = enhancedUser;
		}
		this.address = writeBook.getAddress();
		this.allDedicateMerits = writeBook.getAllDedicateMerits();
		this.dedicateMerits = writeBook.getDedicateMerits();
		this.telephone = writeBook.getTelephone();
		if (writeBook.getBuddhism() != null) {
			EnhancedDBuddhism enhancedDBuddhism = new EnhancedDBuddhism();
			enhancedDBuddhism.setId(writeBook.getBuddhism());
			this.enhancedDBuddhism = enhancedDBuddhism;
		}
		if (writeBook.getBookChapterId() != null) {
			EnhancedEBookChapter enhancedEBookChapter = new EnhancedEBookChapter();
			enhancedEBookChapter.setId(writeBook.getBookChapterId());
			this.enhancedEBookChapter = enhancedEBookChapter;
		}
	}

	public EnhancedWriteBook() {
	}

	private long id;
	private Date createTime;
	private String writeUserName;
	private GenderEnum gender;
	private int age;
	private EnhancedUser enhancedLoginUser;
	private String address;
	private String allDedicateMerits;
	private String dedicateMerits;
	private String telephone;
	private EnhancedDBuddhism enhancedDBuddhism;
	private EnhancedEBookChapter enhancedEBookChapter;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getWriteUserName() {
		return writeUserName;
	}

	public void setWriteUserName(String writeUserName) {
		this.writeUserName = writeUserName;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAllDedicateMerits() {
		return allDedicateMerits;
	}

	public void setAllDedicateMerits(String allDedicateMerits) {
		this.allDedicateMerits = allDedicateMerits;
	}

	public String getDedicateMerits() {
		return dedicateMerits;
	}

	public void setDedicateMerits(String dedicateMerits) {
		this.dedicateMerits = dedicateMerits;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public EnhancedDBuddhism getEnhancedDBuddhism() {
		return enhancedDBuddhism;
	}

	public void setEnhancedDBuddhism(EnhancedDBuddhism enhancedDBuddhism) {
		this.enhancedDBuddhism = enhancedDBuddhism;
	}

	public GenderEnum getGender() {
		return gender;
	}

	public void setGender(GenderEnum gender) {
		this.gender = gender;
	}

	public EnhancedUser getEnhancedLoginUser() {
		return enhancedLoginUser;
	}

	public void setEnhancedLoginUser(EnhancedUser enhancedLoginUser) {
		this.enhancedLoginUser = enhancedLoginUser;
	}

	public EnhancedEBookChapter getEnhancedEBookChapter() {
		return enhancedEBookChapter;
	}

	public void setEnhancedEBookChapter(
			EnhancedEBookChapter enhancedEBookChapter) {
		this.enhancedEBookChapter = enhancedEBookChapter;
	}

}